﻿#region Header
// ------------------------ Licence / Copyright ------------------------
// 
// ScrumTable for Scrum Meeting Support
// Copyright © HSR - Hochschule für Technik Rapperswil
// All Rights Reserved
// 
// Author:
//  Michael Gfeller Silvan Gehrig Patrick Boos
// 
// ---------------------------------------------------------------------
#endregion

#region Usings

using System;
using System.Collections.Generic;
using System.ComponentModel;
using ScrumTable.BL.DM.DataManagement.Logging;
using ScrumTable.BL.DM.DataManagement.Tracking.EditCommands;
using ScrumTable.BL.DM.Properties;
using ScrumTable.Common;
using ScrumTable.Common.Collections;
using ScrumTable.Common.EventHandling;
using ScrumTable.Common.Logging;

#endregion

namespace ScrumTable.BL.DM.DataManagement.Tracking
{
    /// <summary>
    /// Represents the undo/redo manager for all business objects in the
    /// current data store. This class can be used to inform the user about
    /// the undo/redo actions.
    /// </summary>
    public abstract class UndoMultipleTrackingCommandBase : UndoMultipleTrackingBase, IUndoEditCommand
    {
        #region Declarations
        //--------------------------------------------------------------------
        // Declarations
        //--------------------------------------------------------------------

        #endregion

        #region Properties
        //--------------------------------------------------------------------
        // Properties
        //--------------------------------------------------------------------

        /// <summary>
        /// Returns true, if the current edit contains sub edit instances.
        /// </summary>
        internal abstract bool HasSubEdits { get; }

        /// <summary>
        /// Gets/sets the associated domain context.
        /// </summary>
        /// <value></value>
        public abstract IDomainContext Context { get; set; }

        /// <summary>
        /// Gets the state change cause.
        /// </summary>
        public abstract string Cause { get; }

        /// <summary>
        /// Gets the change type which means the element or action that
        /// caused the undo edit entry.
        /// </summary>
        public abstract UndoEditType Type { get; }

        /// <summary>
        /// Gets the name of the domain object which accommodates the change.
        /// </summary>
        public abstract string ElementName { get; }

        #endregion

        #region Constructors / Destructor
        //--------------------------------------------------------------------
        // Constructors / Destructor
        //--------------------------------------------------------------------

        /// <summary>
        /// Creates a new UndoMultipleTrackingCommandBase instance.
        /// </summary>
        protected UndoMultipleTrackingCommandBase()
        {
        }

        #endregion

        #region Methods
        //--------------------------------------------------------------------
        // Methods
        //--------------------------------------------------------------------

        /// <summary>
        /// Executes the underlying undo command.
        /// </summary>
        public abstract void CallUndo();

        /// <summary>
        /// Executes the underlying redo command.
        /// </summary>
        public abstract void CallRedo();

        #endregion

        #region Events
        //--------------------------------------------------------------------
        // Events
        //--------------------------------------------------------------------

        #endregion
    }
}